package com.gitee.lw114514.mybatis.mapper;

import com.gitee.lw114514.mybatis.pojo.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper  //应用程序运行时，会自动创建UserMapper接口的实现类对象，并注入到spring容器中
public interface UserMapper {
//    @Select("select id, username from emp")
    public List<User> FindAll();

    /*
    @Param("id")
     */
//    @Delete("delete from emp where id= #{id}")
    public void DeleteById(Integer id);

//    @Insert("insert into emp(username, name, gender, phone_number) values(#{username}, #{name}, #{gender}, #{phone_number})")
    public void Insert(User user);
}
